<script>
/*
 * @Author: wzh 
 * @Date: 2020-12-30 18:55:05 
 * @Last Modified by: 1521620993@qq.com
 * @Last Modified time: 2020-12-30 19:06:42
 */
</script>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>04-关于百分比取值</title>
</head>
<body>
  <style>
    .parent{
      width: 300px;
      height: 200px;
      background-color: wheat;
    }
    .child{
      height: 50%;
      padding: 10%;
      background-color: red;
      border: 10px solid blue;
      background-clip: content-box;
      box-sizing: border-box;
      margin: 10%;
      width: 50%;
    }
  </style>
  <div class="parent">
    <div class="child"></div>
  </div>
</body>
</html>